<%@ Import namespace="MIMS_WRS.Web" %>
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="StartPage.aspx.vb" Inherits="MIMS_WRS.Web.StartPage"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
  <HEAD>
		<title>Front Page</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link href="./startpage.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="js/common.js"></script>
		<SCRIPT language="javascript" SRC="js/BoxOver.js"></SCRIPT>
		<script language="javascript">
		<!--
		function openBulkOrderList(sort) {
			var ddlSupplier = window.document.getElementById('ddlSupplier');
			
			var ddlConPoint = document.getElementById('<%= ddlConPoint.ClientID %>');
			var conPointID = parseInt(ddlConPoint.options[ddlConPoint.selectedIndex].value)
			/*
			var txtQuantity = window.document.getElementById('txtQty');
			var chkNotAvailInUSA = window.document.getElementById('chkNotAvailInUSA');
			
			if (parseInt(txtQuantity.value, 10) < 0){
				alert('Quantity must be large than 0');
				return false;				
			}
			)
			*/
			
			var type = window.document.getElementById('chkCompleted').checked?1:0;
			if (ddlSupplier != null && ddlSupplier.selectedIndex > 0) {								
				window.location.href = 'Offices/BulkOrderList.aspx?sup=' + ddlSupplier.options[ddlSupplier.selectedIndex].value + '&botype=' + type + '&sort=' + sort + '&conPointID=' + conPointID;// + '&qty=' + txtQuantity.value + '&naUSA=' + (chkNotAvailInUSA.checked?1:0);
			}
			else 
				alert('Please select a supplier to proceed');
				
			return false;
		}
		
		function openBOReport(pageName) {
			
			var rdbBOType = window.document.getElementsByName('rdbBOType');
			var ddlConPoint = window.document.getElementById('<%= ddlConPoint.ClientID %>');
			var ddlSupplier = window.document.getElementById('ddlSupplier');
			var supp = "";
			if (ddlSupplier != null && ddlSupplier.selectedIndex > 0) {	
				supp = ddlSupplier.options[ddlSupplier.selectedIndex].value;
			}	
			var rt;
			if (rdbBOType[0].checked) rt = 0; else rt = 1;
			window.location.href = pageName + 'rt=' + rt + '&showfob=1' + '&cpid=' + ddlConPoint.options[ddlConPoint.selectedIndex].value + '&sup=' + supp;
			return false;
		}
				
		function openPOReport(pageName) {			
			var rdbPOType = window.document.getElementsByName('rdbPOType');			
			var rt;			
			if (rdbPOType[0].checked) rt = 0; else rt = 1;							
			window.location.href = pageName + 'rt=' + rt.toString();
			return false;
		}
		
		function openIDSSalesOrdering() {
			window.location.href = "Offices/CustomerOrders.aspx";
			return false;
		}		
		//-->
		</script>
		<style>
			.tooltipheader { BORDER-RIGHT: #c4d5e3 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #c4d5e3 1px solid; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 11px; BACKGROUND: #c4d5e3; FILTER: alpha(opacity=85); PADDING-BOTTOM: 5px; BORDER-LEFT: #c4d5e3 1px solid; WIDTH: 400px; PADDING-TOP: 5px; BORDER-BOTTOM: #c4d5e3 1px solid; FONT-FAMILY: tahoma, arial; opacity: 0.85; -moz-opacity: 0.85 }
			.tooltipbody { BORDER-RIGHT: #c4d5e3 1px solid; PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 11px; BACKGROUND: #fff; FILTER: alpha(opacity=85); PADDING-BOTTOM: 8px; BORDER-LEFT: #c4d5e3 1px solid; WIDTH: 400px; PADDING-TOP: 8px; BORDER-BOTTOM: #c4d5e3 1px solid; FONT-FAMILY: tahoma, arial; opacity: 0.85; -moz-opacity: 0.85 }
			.tooltiph1 { FONT-WEIGHT: bold; TEXT-DECORATION: underline }
			</style>
</HEAD>
	<body>
		<div id="outerDiv">
			<div id="header">
				<h3>Bulk Order &amp; Purchase Order Status Reporter Front Page</h3>
			</div>
			<div id="subHeader">
				<div id="welcome">Welcome,
					<%= RequestContext.CurrentUser.NAME%>
					!</div>
				<div id="navigation"><% if RequestContext.CurrentUser.IS_ADMIN OrElse RequestContext.CurrentUser.USER_TYPE = 5 then %><a href="Admin/Changepassword.aspx">Change password</a>&nbsp;|&nbsp;<% end if %><a href="Login.aspx?logout=1">Logout</a></div>
			</div>
			<div id="content">
				<form id="Form1" method="post" runat="server">
					<table id="mainTable">
						<tr>
							<td><div class="rbroundbox">
									<div class="rbtop">
										<div></div>
									</div>
									<div class="rbcontent">
										<h4>System configuration</h4>
										<p>change to other office rather than&nbsp;<asp:literal id="ltrOffice" runat="server" enableviewstate="False"></asp:literal>:</p>
										<p id="inputBelow"><asp:dropdownlist id="ddlOffices" runat="server"></asp:dropdownlist>&nbsp;<asp:linkbutton id="lnkSwitchOffice" runat="server">switch</asp:linkbutton></p>
										<% if RequestContext.CurrentUser.IS_ADMIN OrElse RequestContext.CurrentUser.USER_TYPE = 5 then %>
										<ul>
											<li>
												<a href="Offices/Settings/SupplierList.aspx">Advanced settings...</a>
											</li>
										</ul>
										<% end if %>
									</div> <!-- /rbcontent -->
									<div class="rbbot">
										<div></div>
									</div>
								</div> <!-- /rbroundbox --></td>
							<td><div class="rbroundbox">
									<div class="rbtop">
										<div></div>
									</div>
									<div class="rbcontent">
										<h4>Bulk Order</h4>
										<p>select Consolidation points and Supplier:</p>
										<p id="inputBelow"><asp:dropdownlist id="ddlConPoint" runat="server" onchange="conPointchanged('')"></asp:dropdownlist>&nbsp;<span id="divSupplier"></span><input id="chkCompleted" type="checkbox">completed?</p>
										
									</div> <!-- /rbcontent -->
									<div class="rbbot"><div></div>
									</div>
								</div> <!-- /rbroundbox --></td>
						</tr>
						<tr>
							<td><div class="rbroundbox">
									<div class="rbtop">
										<div></div>
									</div>
									<div class="rbcontent">
										<h4><%= RequestContext.OfficeName %>
											P.O. and Container Schedule</h4>
										<ul>
											<li>
												<a href="Offices/OrderList.aspx?sort=0">sort by Requisition No.</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=1">sort by Order Type</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=2">sort by Factory ETD</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=3">sort by Customer/Final Destination</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=4">sort by ETA</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=5">sort by PO Number (Locate Last No)</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=6">sort by Container Delivered Date</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=7">sort by Customer - Proforma Invoice No</a>
											<li>
												<a href="Offices/OrderList.aspx?sort=8">sort by Con Point - Requisition No</a>												
											<li >
												<a href="Offices/OrderList.aspx?sort=9">sort by Sales Order - Requisition No</a>												
											<li>
												<a href="Offices/OrderList.aspx?sort=10">sort by S Invoice No - Req. No - Primary</a>	
											<li class="Last">
												<a href="Offices/OrderList.aspx?sort=11">sort by Customer - S Invoice No - Req. No - Primary</a>	
											</li>
										</ul>
									</div> <!-- /rbcontent -->
									<div class="rbbot">
										<div></div>
									</div>
								</div> <!-- /rbroundbox --></td>
							<td><div class="rbroundbox">
									<div class="rbtop">
										<div></div>
									</div>
									<div class="rbcontent">
										<h4>Bulk Order Sorts</h4>
										<ul>
											<li>
												<a onclick="return openBulkOrderList(<%= EBOSorting.Type %>);" href="javascript:;">sort 
													by Type</a>
											<li>
												<a onclick="return openBulkOrderList(<%= EBOSorting.Owner %>);" href="javascript:;">
													sort by Owner</a>
											<li>
												<a onclick="return openBulkOrderList(<%= EBOSorting.ProductCode %>);" href="javascript:;">
													sort by Product Code</a>
											<li>
												<a onclick="return openBulkOrderList(<%= EBOSorting.OwnerBONo %>);" href="javascript:;">
													sort by Owner - BO No - Product Code</a>
											</li>
										</ul>
									</div> <!-- /rbcontent -->
									<div class="rbbot"><div></div>
									</div>
								</div> <!-- /rbroundbox -->
								<div class="rbroundbox" id="divViewSaleOrders" runat="server" >
									<div class="rbtop">
									<div></div>
									</div>
									<div class="rbcontent">
										<H4 class=rbcontent>IDS</H4>
										<UL>
											<LI><A onclick="return openIDSSalesOrdering();" 
											href="javascript:;">View IDS Sales Orders</A>&nbsp;</LI>
										</UL>
									</div> <!-- /rbcontent -->
									<div class="rbbot"><div></div>
								</div></div>
								</td>
						</tr>
						<tr>
							<td><div class="rbroundbox">
									<div class="rbtop"><div></div>
									</div>
									<div class="rbcontent">
										<h4>P.O Report</h4>
										<p>select type:</p>
										<p><input type="radio" name="rdbPOType" value="0" checked><label for="rdbPOType">incompleted 
												only</label><input type="radio" name="rdbPOType" value="1"><label for="rdbPOType">both</label></p>
										<ul>
											<li>
												<a onclick="return openPOReport('Offices/POReport/DataMissingReport.aspx?')" href="javascript:;"
													title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Data Missing Report] body=[<span class='tooltiph1'>Description:</span><br>For a entry which has a Req report any of the following fields that have no data in them  :- Order Date, Bulk, Size, Pack, Type, Supp, O/No, Prim, Con, Acc No, Customer, Final Destination, Arrival Port, Description<br><br><span class='tooltiph1'>Sort by:</span><br>Req <img src='images/up.gif'>]">
													Data Missing Report</a>
											<li>
												<a onclick="return openPOReport('Offices/POReport/LateFactoryETDReport.aspx?')" href="javascript:;"
													title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Late Factory ETD Report] body=[<span class='tooltiph1'>Description:</span><br>Report that has a Req and Order Date but no Factory ETD within 2 weeks of the Order Date<br><br><span class='tooltiph1'>Sort by:</span><br>Req <img src='images/up.gif'>]">
													Late Factory ETD Report</a>
											<li>
												<a onclick="return openPOReport('Offices/POReport/LateShippedDateReport.aspx?')" href="javascript:;"
													title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Late Shipped Date Report] body=[<span class='tooltiph1'>Description:</span><br>Report that has Factory ETD but no Shipped Date within one week of the Factory ETD<br><br><span class='tooltiph1'>Sort by:</span><br>Req <img src='images/up.gif'>]">
													Late Shipped Date Report</a>
											<li>
												<a onclick="return openPOReport('Offices/POReport/SupplierIncompleteReport.aspx?')" href="javascript:;"
													title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Supplier Incomplete P.O's Report] body=[<span class='tooltiph1'>Description:</span><br>List of Incomplete P.O's of a supplier<br><br><span class='tooltiph1'>Sort by:</span><br>Req <img src='images/up.gif'>]">Supplier Incomplete P.O's Report</a>
											<li>
												<a onclick="return openPOReport('Offices/POReport/OrdersNotPlacedWithFactoryReport.aspx?')" href="javascript:;"
													title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Orders Not Placed With Factory Report] body=[<span class='tooltiph1'>Description:</span><br>should report all Owners Req's entries that have a blank Factory ETD date within 5 days from the Order Date<br><br><span class='tooltiph1'>Sort by:</span><br>Supplier No <img src='images/up.gif'>, Req <img src='images/up.gif'>, Office <img src='images/up.gif'>, Order Date <img src='images/up.gif'>]">Orders Not Placed With Factory Report</a>
											<li>
												<a onclick="return openPOReport('Offices/POReport/ContainerDeliveredReport.aspx?')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Container Delivered Report] body=[<span class='tooltiph1'>Description:</span><br>Container Delivered Report<br><br><span class='tooltiph1'>Sort by:</span><br>Req <img src='images/up.gif'>, Primary <img src='images/up.gif'>]">Container Delivered Report</a></li>
											<li>
												<a onclick="return openPOReport('Offices/POReport/NonPaymentReport.aspx?')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Non Payment Report] body=[<span class='tooltiph1'>Description:</span><br>Type = Direct FOB and Direct HD only, with no date in Sales Invoice paid and Sales Payment Due date is less than  current date<br><br><span class='tooltiph1'>Sort by:</span><br>Sales Payment Due <img src='images/up.gif'>, Customer Or Location <img src='images/up.gif'>, Customer PO Number <img src='images/up.gif'>, Req <img src='images/up.gif'>, Primary <img src='images/up.gif'>]">Non Payment Report</a></li>
											<li>
												<a onclick="return openPOReport('Offices/POReport/NonPaymentLess7Report.aspx?')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Non Payment Report (Less 7 Days)] body=[<span class='tooltiph1'>Description:</span><br>Type = Direct FOB and Direct HD only, with no date in Sales Invoice paid and with a current date 7 days prior to the Sales Payment Due date<br><br><span class='tooltiph1'>Sort by:</span><br>Sales Payment Due <img src='images/up.gif'>, Customer Or Location <img src='images/up.gif'>, Customer PO Number <img src='images/up.gif'>, Req <img src='images/up.gif'>, Primary <img src='images/up.gif'>]">Non Payment Report (Less 7 Days)</a></li>
											
													
										</ul>
									</div> <!-- /rbcontent -->
									<div class="rbbot"><div></div>
									</div>
								</div> <!-- /rbroundbox --></td>
							<td><div class="rbroundbox">
									<div class="rbtop"><div></div>
									</div>
									<div class="rbcontent">
										<h4>B.O Report</h4>
										<p>select type:</p>
										<p><input type="radio" name="rdbBOType" value="0" checked><label for="rdbBOType">incompleted 
												only</label><input type="radio" name="rdbBOType" value="1"><label for="rdbBOType">both</label></p>
										<ul>
											<li>
												<a onclick="return openBOReport('Offices/BOReport/AvailReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Availability report] body=[<span class='tooltiph1'>Description:</span><br>Availability Report<br><br><span class='tooltiph1'>Sort by:</span><br>Product Code <img src='images/up.gif'>, Owner <img src='images/up.gif'>]">Availability Report</a>
											<li>
												<a onclick="return openBOReport('Offices/BOReport/InspectorReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Report (for inspector)] body=[<span class='tooltiph1'>Description:</span><br>Report (for inspector)<br><br><span class='tooltiph1'>Sort by:</span><br>Product Code <img src='images/up.gif'>, Owner <img src='images/up.gif'>]">Inspector Report</a>													
											<li>
												<a onclick="return openBOReport('Offices/BOReport/ProStatReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Production Status report] body=[<span class='tooltiph1'>Description:</span><br>Production Status Report<br><br><span class='tooltiph1'>Sort by:</span><br>Supplier Code <img src='images/up.gif'>, Product Code <img src='images/up.gif'>, Owner <img src='images/up.gif'>]">Production Status Report</a>
														<li>
											<a onclick="return openBOReport('Offices/BOReport/CompletionDateSupplierReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Completion Date Supplier report] body=[<span class='tooltiph1'>Description:</span><br>Completion Date Supplier Report<br><br><span class='tooltiph1'>Sort by:</span><br>Consolidation Point <img src='images/up.gif'>, Supplier Code <img src='images/up.gif'>, Estimated Date <img src='images/up.gif'>, Product Code <img src='images/up.gif'>]">Completion Date Supplier Report</a>
														<li>
												<a onclick="return openBOReport('Offices/BOReport/CompletionDateOwnerReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Completion Date Owner report] body=[<span class='tooltiph1'>Description:</span><br>Completion Date Owner Report<br><br><span class='tooltiph1'>Sort by:</span><br>Owner <img src='images/up.gif'>, Consolidation Point <img src='images/up.gif'>, Supplier Code <img src='images/up.gif'>, Estimated Date <img src='images/up.gif'>, Product Code <img src='images/up.gif'>]">Completion Date Owner Report</a>
											<li>
												<a onclick="return openBOReport('Offices/BOReport/OwnerBulkOrderReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Owner Bulk Order report] body=[<span class='tooltiph1'>Description:</span><br>Owner Bulk Order Report<br><br><span class='tooltiph1'>Sort by:</span><br>Owner <img src='images/up.gif'>, BO Number <img src='images/up.gif'>, Supplier Code <img src='images/up.gif'>, Product Code <img src='images/up.gif'>]">Owner Bulk Order Report</a>	
											<li>
												<a onclick="return openBOReport('Offices/BOReport/BOSalesReport.aspx?owner=-1&amp;type=-1&amp;target=-1&amp;qty=0&amp;naUSA=1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;BO Sales report] body=[<span class='tooltiph1'>Description:</span><br>BO Sales report<br><br><span class='tooltiph1'>Sort by:</span><br>IDS Sort ID <img src='images/up.gif'>, Supplier Code <img src='images/up.gif'>, Product Code <img src='images/up.gif'>]">BO Sales report</a>
											</li>
											<li class="Last">
												<a onclick="return openBOReport('Offices/BOReport/IDSHDReport.aspx?teid=-1&amp;ownerid=-2&amp;type=-1&amp;target=-1&amp;qty=0&amp;naUSA=1&amp;')"
													href="javascript:;" title="cssheader=[tooltipheader] cssbody=[tooltipbody] fade=[on] fadespeed=[0.1] header=[<img src='images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;IDS Home Delivered report] body=[<span class='tooltiph1'>Description:</span><br>IDS Home Delivered report<br><br><span class='tooltiph1'>Sort by:</span><br>IDS Sort ID <img src='images/up.gif'>, Supplier Code <img src='images/up.gif'>, Product Code <img src='images/up.gif'>]">IDS Home Delivered report</a>
											</li>
										</ul>
									</div> <!-- /rbcontent -->
									<div class="rbbot"><div></div>
									</div>
								</div> <!-- /rbroundbox --></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
		
		<script language=javascript>
		var divSupplier = document.getElementById('divSupplier');
		var ddlConPoint = document.getElementById('<%= ddlConPoint.ClientID %>');
		
		
		function callback(res) {
			
			if (res.value) {
				divSupplier.innerHTML = res.value;			
			}
			else
				divSupplier.innerHTML = "";
		}
		
		function conPointchanged(selectedSupplier) {
			divSupplier.innerHTML = "<i>loading supplier...</i>";
			MIMS_WRS.Web.AjaxUtilMethod.GetSupplierHTML(parseInt(ddlConPoint.options[ddlConPoint.selectedIndex].value), selectedSupplier, callback);	
		}
		
		if (ddlConPoint.selectedIndex > 0) {
			
			var selectedSupplier = '<%= RequestContext.SelectedSupplier %>';
			conPointchanged(selectedSupplier);
		}
		
		</script>

	</body>
</HTML>
